<template>
  <basic-container :btnFlag = true>
    <div class="card-border" style="padding-bottom: 58px;">
      <card-header :header-data="headerData"></card-header>
      <bostech-detail :detail-data="detailData"></bostech-detail>
    </div>
  </basic-container>
</template>
<script>
  import {PROJECT_DIC} from '@/const/dict'
  import {projectDetail} from "@/api/planning/project";
  import getDetailData from "@/mixins/getDetailData";
  import {getfileinfopage} from "@/api/system";
  export default {
    name: "regDetail",
    mixins: [getDetailData()],
    data() {
      return {
        multiplefiles:[],
        headerData:{
          title:''
        }
      };
    },
    created(){
      this.getDetailData();
    },
    methods: {
      getDetailData(){
        projectDetail(this.$route.params.id).then(response => {
          this.getresultDetail(response);
        })
      },
      async  getresultDetail(response){
        if(response.data.code == '0') {
          var records = response.data.data
          if(records.fileId!="" && records.fileId !=null) {
            this.multiplefiles = [];
            this.multiplefiles = await this.getfileinfopagetemp(records);
          }
          this.getDetailDataMins(records)
          this.headerData.title = records.title
        }
      },
      getfileinfopagetemp(records){
        return new Promise((resolve, reject) => {
          if(records.fileId!="" && records.fileId !=null){
            getfileinfopage(Object.assign({
              current: 1,
              size: 100,
              fileIds:records.fileId
            })).then(response => {
              var multiplefiles = response.data.data.records;
              resolve(multiplefiles);
            }).catch(
            )
          }
        })
      },
    }
  };
</script>

<style lang="scss" scoped>

</style>
